home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 098 / cstd.arc / CSTD8#1 < prev    next >
Encoding:
Internet Message Format  |  1985-07-28  |  3.8 KB

  1. From: Orlando Sotomayor-Diaz (The Moderator) <cbosgd!std-c>
  2.  
  3.  
  4. mod.std.c Digest            Mon,  1 Jul 85       Volume 8 : Issue   1 
  5.  
  6. Today's Topics:
  7.                  C comments (Section C.1.7) (3 msgs)
  8. ----------------------------------------------------------------------
  9.  
  10. Date: Wed, 26 Jun 85 00:16:48 edt
  11. From: Barry Margolin <packard!harvard!mit-eddie!barmar>
  12. Subject: C comments (Section C.1.7)
  13. To: cbosgd!std-c
  14.  
  15. In article <566@hou2d.UUCP> seismo!elsie!ado writes:
  16. >*      Section C.1.7, page 22:
  17. >
  18. >               The contents of a comment are examined only to find the
  19. >               characters */ that terminate it.  Thus comments do not nest.
  20. >
  21. >       and section E.3, page 135, listing "common warnings":
  22. >
  23. >               The characters /* are found in a comment.
  24. >
  25. >       Sorry. . .if you're only allowed to look for the */ that terminates
  26. >       a comment, you can't look for a /*.  Change the first quote to:
  27. >
  28. >               The contents of a comment are examined to find the characters
  29. >               */ that terminate it.  Comments do not nest.
  30.  
  31. There is nothing wrong with a compiler generating a warning for a common
  32. typo, although there should be a way to disable it.  The first quote
  33. only implies that the lexical analysis should still treat it as a
  34. comment.  That's why it is a warning, not an error: the program is
  35. valid, but the compiler has reason to be suspicious that the user might
  36. not have meant what he said.
  37.  
  38. ------------------------------
  39.  
  40. Date: Wed, 26 Jun 85 21:15:03 EDT
  41. From: harvard!seismo!elsie!ado
  42. Subject: C comments (Section C.1.7)
  43. To: mit-eddie!barmar
  44.  
  45. I certainly agree that allowing compilers to look for potential typos is a
  46. good thing--in fact, the C compiler here on elsie looks for and warns about
  47. "possibly nested comments."  I'd like to keep that behavior without having our
  48. compiler be out of step with the standard.
  49.  
  50. > The. . .quote only implies that the lexical analysis should still
  51. > treat it as a comment. . .
  52.  
  53. Now here our views are different.  To me, that "only" in the quote is the key
  54. word--if comments may be examined ONLY to find the */ that terminates them,
  55. then they cannot be examined for purposes of generating warnings.  Which is why
  56. I suggested dropping the "only."
  57.  
  58. Can folks think of a better wording for the section in question that both gets
  59. across the idea of comments not nesting and avoids disallowing warnings?
  60.  
  61.                                 --ado
  62.  
  63. ------------------------------
  64.  
  65. Date: Thu, 27 Jun 85 03:29:11 edt
  66. From: Barry Margolin <ihnp4!seismo!harvard.ARPA!barmar%mit-eddie.UUCP>
  67. Subject: C comments (Section C.1.7)
  68. To: seismo.ARPA!elsie!ado, seismo.ARPA!harvard!mit-eddie!barmar
  69.  
  70. Perhaps the section could read something like "for purposes of determining
  71. the meaning of program source, comments may be examined only to find the
  72. */ ...."  I am not really happy with my wording here, but the idea is that
  73. it should specify that this description applies only to the parse used
  74. to translate the program, but doesn't restrict it from further examining
  75. the comment for other purposes.
  76.  
  77. I don't have a copy of the standard, so I don't know if this is in there:
  78. the section that suggests warning about a /* found in a quote should
  79. strongly suggest that if this is done then there should be a way to
  80. disable it.  Many shops (for instance, Multics System Development, where
  81. I work) have rules that programs must compile without any errors or
  82. warnings or they will not be installed into the system library.
  83.  
  84.     Barry Margolin
  85.     ARPA: barmar@MIT-Multics
  86.     UUCP: ..!genrad!mit-eddie!barmar
  87.  
  88. ------------------------------
  89.  
  90. End of mod.std.c Digest - Mon,  1 Jul 85 09:45:01 EDT
  91. ******************************
  92.